<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionView::TestCase::Behavior::RenderedViewsCollection</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionView::TestCase::Behavior::RenderedViewsCollection 
            
                <span class="parent">&lt; 
                    
                    <a href="../../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../../files/actionpack/lib/action_view/test_case_rb.html">actionpack/lib/action_view/test_case.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RenderedViewsCollection.html#method-i-add">add</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>L</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RenderedViewsCollection.html#method-i-locals_for">locals_for</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RenderedViewsCollection.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RenderedViewsCollection.html#method-i-rendered_views">rendered_views</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>V</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RenderedViewsCollection.html#method-i-view_rendered-3F">view_rendered?</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>()
            
            <a href="RenderedViewsCollection.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/73deb3af23765882f67869afb4eaa8ad74a351d1/actionpack/lib/action_view/test_case.rb#L124" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/test_case.rb, line 124</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>
  <span class="ruby-ivar">@rendered_views</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">hash</span>, <span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] = [] }
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-add">
            
              <b>add</b>(view, locals)
            
            <a href="RenderedViewsCollection.html#method-i-add" name="method-i-add" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-add_source')" id="l_method-i-add_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/73deb3af23765882f67869afb4eaa8ad74a351d1/actionpack/lib/action_view/test_case.rb#L128" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-add_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/test_case.rb, line 128</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">add</span>(<span class="ruby-identifier">view</span>, <span class="ruby-identifier">locals</span>)
  <span class="ruby-ivar">@rendered_views</span>[<span class="ruby-identifier">view</span>] <span class="ruby-operator">||=</span> []
  <span class="ruby-ivar">@rendered_views</span>[<span class="ruby-identifier">view</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">locals</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-locals_for">
            
              <b>locals_for</b>(view)
            
            <a href="RenderedViewsCollection.html#method-i-locals_for" name="method-i-locals_for" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-locals_for_source')" id="l_method-i-locals_for_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/73deb3af23765882f67869afb4eaa8ad74a351d1/actionpack/lib/action_view/test_case.rb#L133" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-locals_for_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/test_case.rb, line 133</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">locals_for</span>(<span class="ruby-identifier">view</span>)
  <span class="ruby-ivar">@rendered_views</span>[<span class="ruby-identifier">view</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rendered_views">
            
              <b>rendered_views</b>()
            
            <a href="RenderedViewsCollection.html#method-i-rendered_views" name="method-i-rendered_views" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-rendered_views_source')" id="l_method-i-rendered_views_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/73deb3af23765882f67869afb4eaa8ad74a351d1/actionpack/lib/action_view/test_case.rb#L137" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-rendered_views_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/test_case.rb, line 137</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">rendered_views</span>
  <span class="ruby-ivar">@rendered_views</span>.<span class="ruby-identifier">keys</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-view_rendered-3F">
            
              <b>view_rendered?</b>(view, expected_locals)
            
            <a href="RenderedViewsCollection.html#method-i-view_rendered-3F" name="method-i-view_rendered-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-view_rendered-3F_source')" id="l_method-i-view_rendered-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/73deb3af23765882f67869afb4eaa8ad74a351d1/actionpack/lib/action_view/test_case.rb#L141" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-view_rendered-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/test_case.rb, line 141</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">view_rendered?</span>(<span class="ruby-identifier">view</span>, <span class="ruby-identifier">expected_locals</span>)
  <span class="ruby-identifier">locals_for</span>(<span class="ruby-identifier">view</span>).<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">actual_locals</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">expected_locals</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">actual_locals</span>[<span class="ruby-identifier">key</span>] }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    